home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / acpi / hibernate.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-10-15  |  967 b   |  45 lines

  1. #!/bin/bash
  2.  
  3. . /etc/default/acpi-support
  4. . /usr/share/acpi-support/power-funcs
  5. . /usr/share/acpi-support/policy-funcs
  6.  
  7. if [ x$ACPI_HIBERNATE != xtrue ] && [ x$1 != xforce ]; then
  8.   exit;
  9. fi
  10.  
  11. # Unset video posting - it's not needed for suspend to disk
  12. unset POST_VIDEO
  13. unset USE_DPMS
  14.  
  15. . /etc/acpi/prepare.sh
  16.  
  17. #if [ x$LOCK_SCREEN = xtrue ]; then
  18. #    for x in /tmp/.X11-unix/*; do
  19. #    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
  20. #    getXuser;
  21. #    if [ x"$XAUTHORITY" != x"" ]; then
  22. #        export DISPLAY=":$displaynum"
  23. #        . /usr/share/acpi-support/screenblank
  24. #    fi
  25. #    done
  26. #fi
  27.  
  28. echo -n $HIBERNATE_MODE >/sys/power/disk
  29.  
  30. if [ -x /sbin/s2disk ]; then
  31.     DEVICE="/dev/disk/by-uuid/`awk -F= '{print $3}' </etc/initramfs-tools/conf.d/resume`"
  32.     if [ -f /etc/usplash.conf ]; then
  33.     . /etc/usplash.conf
  34.     /sbin/s2disk -x "$xres" -y "$yres" $DEVICE
  35.     else
  36.     /sbin/s2disk $DEVICE
  37.     fi
  38. else
  39.     echo -n "disk" >/sys/power/state
  40. fi
  41.  
  42. $LAPTOP_MODE stop
  43.  
  44. . /etc/acpi/resume.sh
  45.